package com.sky.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Objects;

/**
 * 套餐
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Setmeal implements Serializable {

    private static final long serialVersionUID = 1L;

    private Long id;

    //分类id
    private Long categoryId;

    //套餐名称
    private String name;

    //套餐价格
    private BigDecimal price;

    //状态 0:停用 1:启用
    private Integer status;

    //描述信息
    private String description;

    //图片
    private String image;

    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @TableField(fill = FieldFill.INSERT)
    private Long createUser;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateUser;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Setmeal)) return false;
        Setmeal setmeal = (Setmeal) o;
        return Objects.equals(getId(), setmeal.getId()) && Objects.equals(getCategoryId(), setmeal.getCategoryId()) && Objects.equals(getName(), setmeal.getName()) && Objects.equals(getPrice(), setmeal.getPrice()) && Objects.equals(getStatus(), setmeal.getStatus()) && Objects.equals(getDescription(), setmeal.getDescription()) && Objects.equals(getImage(), setmeal.getImage()) && Objects.equals(getCreateTime(), setmeal.getCreateTime()) && Objects.equals(getUpdateTime(), setmeal.getUpdateTime()) && Objects.equals(getCreateUser(), setmeal.getCreateUser()) && Objects.equals(getUpdateUser(), setmeal.getUpdateUser());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getId(), getCategoryId(), getName(), getPrice(), getStatus(), getDescription(), getImage(), getCreateTime(), getUpdateTime(), getCreateUser(), getUpdateUser());
    }


}
